import Vue from 'vue'
import Router from 'vue-router'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'
import NoMatch from '../views/NoMatch.vue'
import Main from '../views/home/Main.vue'
import User from '../views/home/User.vue'
import Book from '../views/home/Book.vue'
import List from '../views/home/List.vue'
import Form from '../views/home/Form.vue'
import Lib from '../views/home/Lib.vue'
import BookList from '../views/home/BookList.vue'
import BookForm from '../views/home/BookForm.vue'
import Update from '../views/home/Update.vue'
Vue.use(Router)



export default new Router({
    //mode: 'history',
    routes: [
        {path: '', redirect: '/login'},
        { path: '/login', component: Login},
        { path: '/home', component: Home,children:[
            { path: '/home', redirect: '/home/main'},
            { path: '/home/main', component: Main},
            { path: '/home/user', component: User, children:[
                { path: '/home/user', redirect: '/home/user/list'},
                { path: 'list', component: List},
                { path: 'form', component: Form},
                { path: 'update', component: Update, name:'Update'},
                { path: 'lib', component: Lib, name:'Lib'},
            ]},
            { path: '/home/book', component: Book,children:[
                {path: '/home/book',redirect: '/home/book/list'},
                {path: 'list', component: BookList},
                {path: 'form', component: BookForm},
            ]},
        ]},
        { path: '/404', component: NoMatch},
        { path: '*', redirect: '/404'}
        // 注册用户  修改密码 密码找回
    ]
});